Skip to content

Conversation

@jychoe013
Copy link

Summary

When using http_basic authentication with standard Gerrit instances, the REST API requires the /a/ prefix for authenticated access.

Problem:

  • Without /a/ prefix, the /changes/ endpoint returns anonymous/public data only
  • Credentials sent via --user are silently ignored
  • Queries like owner:self fail with "Must be signed-in to use this operator"

Solution:

  • Changed all /changes/ endpoints to /a/changes/
  • This ensures http_basic authentication works correctly

Testing

Tested against a self-hosted Gerrit instance (v3.x) using http_basic authentication:

  • Before: All queries returned empty results or auth errors
  • After: Authentication works correctly, queries return expected results

Reference

When using http_basic authentication with standard Gerrit instances,
the REST API requires the /a/ prefix for authenticated access.

Without this prefix:
- /changes/ endpoint returns anonymous/public data only
- Credentials sent via --user are silently ignored

With this fix:
- /a/changes/ endpoint properly authenticates requests
- All http_basic auth configurations now work correctly

This issue was found when using the MCP server with a self-hosted
Gerrit instance using http_basic authentication. Queries like
"owner:self" failed with "Must be signed-in to use this operator"
despite valid credentials being configured.

Reference: https://gerrit-review.googlesource.com/Documentation/rest-api.html#authentication
@google-cla
Copy link

google-cla bot commented Jan 7, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant